import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/page/index/index'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/home',
      component: Layout,
      redirect: '/home/index',
      children: [{
        path: 'index',
        name: '主页',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/home/index')
      }]
    },
    {
      path: '/',
      name: '主页',
      redirect: '/home'
    },
    {
      path: '/type',
      component: Layout,
      redirect: '/type/index',
      children: [{
        path: 'index',
        name: '分类',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/type/index')
      }]
    },
    {
      path: '/video',
      component: Layout,
      redirect: '/video/index',
      children: [{
        path: 'index',
        name: 'U袋学堂',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/video/index')
      }]
    },
    {
      path: '/enterprise',
      component: Layout,
      redirect: '/enterprise/index',
      children: [{
        path: 'index',
        name: '企业账号',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/enterprise/index')
      }]
    },
    {
      path: '/contract',
      component: Layout,
      redirect: '/contract/index',
      children: [{
        path: 'index',
        name: '诚信合约',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/contract/index')
      }]
    },
    {
      path: '/shelf',
      component: Layout,
      redirect: '/shelf/index',
      children: [{
        path: 'index',
        name: '实时下架',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/shelf/index')
      }]
    },
    {
      path: '/product',
      component: Layout,
      redirect: '/product/detail',
      children: [{
        path: 'detail',
        name: '商品详情',
        component: () =>
          import( /* webpackChunkName: "views" */ '@/views/product_detail/index')
      }]
    },
    {
      path: '/login',
      name: '登录页',
      component: () =>
        import( /* webpackChunkName: "page" */ '@/page/login/index'),
    },
  ]
})
